import java.io.DataInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.Scanner;

public class Client {
	static String host = "127.0.0.1";
	static int port = 6000;
	static Scanner sc;
	static ObjectOutputStream os;
	static Socket client;
	static String msg = null;
	static DataInputStream dis = null;
	static ObjectInputStream is;
	public static void main(String[] args) throws UnknownHostException, IOException, ClassNotFoundException {
		//Client c = new Client();
		client = new Socket(host, port);
		if (client.isConnected())
			System.out.println("Cliente Conectado "+host+":"+port);
		dis  = new DataInputStream(System.in);
		os = new ObjectOutputStream(client.getOutputStream());
		is = new ObjectInputStream (client.getInputStream());
		while(dis.read() > 0){
			msg = dis.readLine();
			os.writeObject("Cliente :"+msg);
			os.flush();
			System.out.println("Cliente :"+msg);
		}
		is.close(); os.close();
	}
}